#!/bin/bash
set -ex

function BuildGas() {
# as boot_gas.s -o boot.o
as -arch i386 boot_gas.s -o boot.o
}

function BuildNasm() {
nasm boot_nasm.s -o boot.o
}

function WriteToImg() {
dd if=/dev/zero of=boot.img bs=512 count=2880
dd if=boot.o of=boot.img bs=512 count=1
dd if=/dev/zero of=boot.img skip=1 seek=1 bs=512 count=2879
}

# BuildGas
BuildNasm
WriteToImg
